<div id="PeopleTableContainer"></div>
<div class="addRecord"></div>
<script type="text/javascript">

    $(document).ready(function() {

        //Prepare jTable
        $('#PeopleTableContainer').jtable({
            title: 'Danh sách tài khoản',
            paging: true,
            pageSize: 15,
            pageSizeChangeArea: false,
            sorting: true,
            defaultSorting: 'UserName ASC',
            actions: {
                listAction: '<?php echo base_url('admin/account/getList'); ?>',
                deleteAction: '<?php echo base_url('admin/account/deleteAccount'); ?>',
                createAction: '<?php echo base_url('admin/account/addAccount'); ?>',
                updateAction: '<?php echo base_url('admin/account/updateAccount'); ?>',
            },
            fields: {
                UserName: {
                    key: true,
                    create: true,
                    edit: true,
                    list: true,
                    title: 'Tên tài khoản',
                    width: '30%',
                    
                },
                PassWord: {
                    title: 'Mật khẩu',
                    type: 'password',
                    visibility: 'hidden'

                },
                TacNhan: {
                    title: 'Tác nhân',
                    width: '30%',
                    options: { '0': 'nhân viên', '1': 'admin' }
                },
                MaHoSo: {
                    title: 'Mã Hồ Sơ',
                    options: '<?php echo base_url("/admin/luongthuong/maHoSo"); ?>',

                },
                
            },
        });

        //Load person list from server
        $('#PeopleTableContainer').jtable('load');
        $('.addRecord').addRecordButton;

    });



</script>